package data

import (
	//"ac-julink/tool/md5"
	"ac-julink/tool/sha256"
    log "ac-common-go/glog"
)

//组装HS{}MD5\r\n格式数据包
func PackageMsg(_json, _prekey string) (result string) {
	msgHead := "HS"
	msgPack := msgHead + _json
	//md5, _ := md5.Md5Encode(_prekey + _json) //MD5加密(预制密钥+JSON串),取16位
	//msgPack = msgPack + md5 + "\r\n"
	sha256, _ := sha256.Sha256Encode(_prekey + _json) //sha256加密(预制密钥+JSON串),取16位
	msgPack = msgPack + sha256 + "\r\n"
	log.Infof("PackageMsg:%s", msgPack)
	return msgPack
}
